package com.yzc.android.ui.viewholder;

import android.text.format.DateUtils;
import android.view.View;
import android.widget.TextView;

import butterknife.Bind;
import butterknife.ButterKnife;
import com.yzc.android.R;
import com.yzc.android.network.response.SectionDataResponse;
import com.yzc.android.utils.LogUtils;

/**
 * Created by yzc on 16/4/21.
 */
public class ItemViewHolder extends KDBaseViewHolder<SectionDataResponse> {
    @Bind(R.id.recycler_view_item_tv_title)
    public TextView label;

    @Bind(R.id.recycler_view_item_tv_datetime)
    public TextView dateTime;

    public ItemViewHolder(View itemView) {
        super(itemView);
        ButterKnife.bind(this, itemView);
    }

    @Override
    public void showData(final int position, final SectionDataResponse itemData) {
        label.setText(itemData.mContent);
        String dateStr = DateUtils.formatDateTime(label.getContext(), System.currentTimeMillis(), DateUtils.FORMAT_ABBREV_ALL);
        dateTime.setText(dateStr);
    }

    @Override
    public void onItemSelected() {
        LogUtils.d("onItemSelected");
    }

    @Override
    public void onItemClear() {
        LogUtils.d("onItemClear");
    }
}
